# run_tests.py
from datetime import datetime

from utils.report_generator import generate_html_report, generate_allure_report
from utils.email_sender import send_email


def run_tests():
    # 生成 HTML 报告
    report_html_path = generate_html_report()
    #
    # 生成allure测试报告
    report_allure_path = generate_allure_report()
    # 发送邮件
    send_email(
        subject=f"测试报告{datetime}",
        body="请查收附件中的测试报告。",
        attachment_path=report_html_path,
    )


if __name__ == "__main__":
    run_tests()
